Optimal. Leaf size=113 \[ \frac {(3 A+i B) x}{8 a c^2}-\frac {A+i B}{8 a c^2 f (i-\tan (e+f x))}+\frac {i A+B}{8 a c^2 f (i+\tan (e+f x))^2}+\frac {A}{4 a c^2 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209}
\begin {gather*} -\frac {A+i B}{8 a c^2 f (-\tan (e+f x)+i)}+\frac {B+i A}{8 a c^2 f (\tan (e+f x)+i)^2}+\frac {x (3 A+i B)}{8 a c^2}+\frac {A}{4 a c^2 f (\tan (e+f x)+i)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x)) (c-i c \tan (e+f x))^2} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^2 (c-i c x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {-A-i B}{8 a^2 c^3 (-i+x)^2}-\frac {i (A-i B)}{4 a^2 c^3 (i+x)^3}-\frac {A}{4 a^2 c^3 (i+x)^2}+\frac {3 A+i B}{8 a^2 c^3 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {A+i B}{8 a c^2 f (i-\tan (e+f x))}+\frac {i A+B}{8 a c^2 f (i+\tan (e+f x))^2}+\frac {A}{4 a c^2 f (i+\tan (e+f x))}+\frac {(3 A+i B) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 a c^2 f}\\ &=\frac {(3 A+i B) x}{8 a c^2}-\frac {A+i B}{8 a c^2 f (i-\tan (e+f x))}+\frac {i A+B}{8 a c^2 f (i+\tan (e+f x))^2}+\frac {A}{4 a c^2 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.24, size = 166, normalized size = 1.47 \begin {gather*} \frac {(2 (A (-3-6 i f x)+B (i+2 f x)) \cos (e+f x)+(A+3 i B) \cos (3 (e+f x))-(9 i A+B+12 A f x+4 i B f x+(6 i A-2 B) \cos (2 (e+f x))) \sin (e+f x)) (\cos (2 (e+f x))+i \sin (2 (e+f x))) (A+B \tan (e+f x))}{32 a c^2 f (A \cos (e+f x)+B \sin (e+f x)) (-i+\tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 106, normalized size = 0.94
method | result | size |
derivativedivides | \(\frac {\frac {A}{4 i+4 \tan \left (f x +e \right )}+\left (\frac {3 i A}{16}-\frac {B}{16}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {-\frac {i A}{4}-\frac {B}{4}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}+\left (-\frac {3 i A}{16}+\frac {B}{16}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{8}-\frac {i B}{8}}{-i+\tan \left (f x +e \right )}}{f a \,c^{2}}\) | \(106\) |
default | \(\frac {\frac {A}{4 i+4 \tan \left (f x +e \right )}+\left (\frac {3 i A}{16}-\frac {B}{16}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {-\frac {i A}{4}-\frac {B}{4}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}+\left (-\frac {3 i A}{16}+\frac {B}{16}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-\frac {A}{8}-\frac {i B}{8}}{-i+\tan \left (f x +e \right )}}{f a \,c^{2}}\) | \(106\) |
risch | \(\frac {i x B}{8 a \,c^{2}}+\frac {3 x A}{8 a \,c^{2}}-\frac {{\mathrm e}^{4 i \left (f x +e \right )} B}{32 a \,c^{2} f}-\frac {i {\mathrm e}^{4 i \left (f x +e \right )} A}{32 a \,c^{2} f}-\frac {\cos \left (2 f x +2 e \right ) B}{8 a \,c^{2} f}-\frac {i \cos \left (2 f x +2 e \right ) A}{8 a \,c^{2} f}+\frac {A \sin \left (2 f x +2 e \right )}{4 a \,c^{2} f}\) | \(130\) |
norman | \(\frac {\frac {\left (i B +3 A \right ) x}{8 a c}-\frac {i A +B}{4 a c f}+\frac {\left (i B +3 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{8 a c f}+\frac {\left (i B +3 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{4 a c}+\frac {\left (i B +3 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{8 a c}+\frac {\left (-i B +5 A \right ) \tan \left (f x +e \right )}{8 a c f}}{c \left (1+\tan ^{2}\left (f x +e \right )\right )^{2}}\) | \(154\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.97, size = 84, normalized size = 0.74 \begin {gather*} \frac {{\left (4 \, {\left (3 \, A + i \, B\right )} f x e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, A - B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 2 \, {\left (3 i \, A + B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 i \, A - 2 \, B\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{32 \, a c^{2} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.28, size = 284, normalized size = 2.51 \begin {gather*} \begin {cases} \frac {\left (\left (512 i A a^{2} c^{4} f^{2} - 512 B a^{2} c^{4} f^{2}\right ) e^{- 2 i f x} + \left (- 1536 i A a^{2} c^{4} f^{2} e^{4 i e} - 512 B a^{2} c^{4} f^{2} e^{4 i e}\right ) e^{2 i f x} + \left (- 256 i A a^{2} c^{4} f^{2} e^{6 i e} - 256 B a^{2} c^{4} f^{2} e^{6 i e}\right ) e^{4 i f x}\right ) e^{- 2 i e}}{8192 a^{3} c^{6} f^{3}} & \text {for}\: a^{3} c^{6} f^{3} e^{2 i e} \neq 0 \\x \left (- \frac {3 A + i B}{8 a c^{2}} + \frac {\left (A e^{6 i e} + 3 A e^{4 i e} + 3 A e^{2 i e} + A - i B e^{6 i e} - i B e^{4 i e} + i B e^{2 i e} + i B\right ) e^{- 2 i e}}{8 a c^{2}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (3 A + i B\right )}{8 a c^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.69, size = 169, normalized size = 1.50 \begin {gather*} \frac {\frac {2 \, {\left (3 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a c^{2}} + \frac {2 \, {\left (-3 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a c^{2}} - \frac {2 \, {\left (3 \, A \tan \left (f x + e\right ) + i \, B \tan \left (f x + e\right ) - 5 i \, A + 3 \, B\right )}}{a c^{2} {\left (i \, \tan \left (f x + e\right ) + 1\right )}} + \frac {-9 i \, A \tan \left (f x + e\right )^{2} + 3 \, B \tan \left (f x + e\right )^{2} + 26 \, A \tan \left (f x + e\right ) + 6 i \, B \tan \left (f x + e\right ) + 21 i \, A + B}{a c^{2} {\left (\tan \left (f x + e\right ) + i\right )}^{2}}}{32 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.06, size = 129, normalized size = 1.14 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-\frac {B}{8\,a\,c^2}+\frac {A\,3{}\mathrm {i}}{8\,a\,c^2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {3\,A}{8\,a\,c^2}+\frac {B\,1{}\mathrm {i}}{8\,a\,c^2}\right )+\frac {A}{4\,a\,c^2}-\frac {B\,1{}\mathrm {i}}{4\,a\,c^2}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^3+{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}+\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}-\frac {x\,\left (-B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a\,c^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________